#! /usr/bin/env python
import sys
import os
# this is kind of an installer for it This could probably be replaced by a shortcut?

def install(name, file):
    question = raw_input("Would you like to download "+name+"? [y/n]")
    if (lower(question)=='yes') or (lower(question)=='y'):
        if (os.name == "nt"):
            import urllib
            popen("/data/pygame.exe")
        else:
            print "ok so apparrently you don't have windows... (good job!)"
            print "but the question is what do you have?"
            whatos = raw_input("[debian, ubuntu, mac, other]")
            if (whatos == "debian") or (whatos == "ubuntu"):
                popen("sudo apt-get install python-pygame")
            else:
                print "this is unsupported at this time sorry!"
    elif(lower(question)=='no') or (lower(question)=='n'):
        print "ok bye... maybe you'll try later?"
        return
    else:
        print "srry couldn't read that try again."
        install(name,file)

try:
    __file__
except NameError:
    pass
else:
    srcdir = os.path.abspath(os.path.join(os.path.dirname(__file__), 'src'))
    sys.path.insert(0, srcdir)

try:
    import pygame
    from pygame.locals import *
except ImportError, errmsg:
    print "This requires PyGame"
    print errmsg
    install(file)

import heibertrpg
heibertrpg.start()